package com.etv.launcher.ui.actvity;

import android.annotation.SuppressLint;
import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;

import com.etv.launcher.R;
import com.etv.launcher.common.utils.ToastUtil;
import com.etv.launcher.databinding.ActivityMainBinding;
import com.etv.launcher.ui.actvity.desktop.DesktopFragment;

import dagger.hilt.android.AndroidEntryPoint;

@AndroidEntryPoint
@SuppressLint("CustomSplashScreen")
public class MainActivity extends FullScreenActivity {
    private ActivityMainBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
    }


    @Override
    @SuppressLint("MissingSuperCall")
    public void onBackPressed() {
        Fragment currentFragment = getSupportFragmentManager().findFragmentById(R.id.root_fragment);
        if (currentFragment instanceof DesktopFragment) {
            ((DesktopFragment) currentFragment).onBackPressed();
        }
    }
}